var index = 1;
var time = setInterval(lunbo, 1500);
function lunbo() {
    index++;
    if (index > 4) {
        index = 1;
    }
    var img = document.getElementById("lunbo_img");
    img.src = "./images/banner_" + index + ".jpg";
}

var toleft = function () {
    clearInterval(time);
    if (index == 1) {
        index = 4;
    } else {
        index--;
    }
    let img = document.getElementById("lunbo_img");
    img.src = "./images/banner_" + index + ".jpg";
    time = setInterval(lunbo, 1500);
}

var toright = function () {
    clearInterval(time);
    if (index == 4) {
        index = 1;
    } else {
        index++;
    }
    let img = document.getElementById("lunbo_img");
    img.src = "./images/banner_" + index + ".jpg";
    time = setInterval(lunbo, 1500);
}

var stopimg = function () {
    clearInterval(time);
}

var startimg = function () {
    time = setInterval(lunbo, 1500);
}